#include "ActorEntitySceneNode.h";

ActorEntitySceneNode::ActorEntitySceneNode(WorldEnums::eSceneryObjects sceneryId, eActorType mActorType, Ogre::String mName, NxOgre::SceneGeometry *mActor, Ogre::SceneNode* mSceneNode, Ogre::Entity* mEntity) : NxOgre::Callback()
{
	this->mSceneryId = sceneryId;
	this->mActorType = mActorType;
	this->mName = mName;
	this->mActor = mActor;
	this->mSceneNode = mSceneNode;
	this->mEntity = mEntity;

	isPhisical = true;
}

//------------------------------------------------------------------------------------------------------------------------

ActorEntitySceneNode::ActorEntitySceneNode(WorldEnums::eSceneryObjects sceneryId, Ogre::String mName, NxOgre::SceneGeometry *mActor, Ogre::SceneNode* mSceneNode, Ogre::Entity* mEntity) : NxOgre::Callback()
{
	this->mSceneryId = sceneryId;
	this->mName = mName;
	this->mActor = mActor;
	this->mSceneNode = mSceneNode;
	this->mEntity = mEntity;

	isPhisical = true;
}

//------------------------------------------------------------------------------------------------------------------------

ActorEntitySceneNode::~ActorEntitySceneNode(void)
{
	mSceneNode->detachAllObjects();
}

//------------------------------------------------------------------------------------------------------------------------

Ogre::String ActorEntitySceneNode::getName(void)
{
	return mName;
}

//-----------------------------------------------------------------------------------------------------------------------

WorldEnums::eSceneryObjects ActorEntitySceneNode::getSceneryId(void)
{
	return mSceneryId;
}

//-----------------------------------------------------------------------------------------------------------------------

ActorEntitySceneNode::eActorType ActorEntitySceneNode::getActorType(void)
{
	return mActorType;
}

//------------------------------------------------------------------------------------------------------------------------

NxOgre::SceneGeometry *ActorEntitySceneNode::getActor(void)
{
	return mActor;
}

//------------------------------------------------------------------------------------------------------------------------

Ogre::SceneNode* ActorEntitySceneNode::getSceneNode(void)
{
	return mSceneNode;
}

//------------------------------------------------------------------------------------------------------------------------

Ogre::Entity* ActorEntitySceneNode::getEntity(void)
{
	return mEntity;
}

//------------------------------------------------------------------------------------------------------------------------

void ActorEntitySceneNode::setName(Ogre::String name)
{
	this->mName = name;
}

//------------------------------------------------------------------------------------------------------------------------

void ActorEntitySceneNode::onVolumeEvent(NxOgre::Volume* volume, NxOgre::Shape* volumeShape, NxOgre::RigidBody* collision_body, NxOgre::Shape* rigidBodyShape, unsigned int collisionEvent)
{
	std::cout << mName << " collided with something";
}

//-------------------------------------------------------------------------------------------------------------------------

void ActorEntitySceneNode::onContact(const NxOgre::ContactPair& pair)
{
	std::cout << mName << " collided with something";
}

//-------------------------------------------------------------------------------------------------------------------------